{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 控制结构\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Overwriting aboutControl.py\n"
     ]
    }
   ],
   "source": [
    "%%writefile aboutControl.py\n",
    "\n",
    "temp = 90\n",
    "if temp>=90:\n",
    "    print(\"genious\")\n",
    "elif temp>=80:\n",
    "    print('great')\n",
    "elif temp>=70:\n",
    "    print('good')\n",
    "else:\n",
    "    print('not good')\n",
    "\n",
    "\n",
    "index = 0\n",
    "while index < 10:\n",
    "    print('index ={}'.format(index))\n",
    "    index = index + 1\n",
    "else:\n",
    "    print('iteration is over')\n",
    "\n",
    "for i in range(0,8):\n",
    "    print(i,end=' ')\n",
    "else:\n",
    "    print('\\n now i = {} '.format(i))\n",
    "    \n",
    "print('**********')\n",
    "index = 0\n",
    "while index < 10:\n",
    "    if index > 5:\n",
    "        break;\n",
    "    print('index ={}'.format(index))\n",
    "    index = index + 1\n",
    "\n",
    "print('{:*^20s}'.format('print all evens'))\n",
    "index = 0\n",
    "\n",
    "while index < 10:\n",
    "    if index%2 == 0:\n",
    "        index = index + 1\n",
    "        continue;\n",
    "        \n",
    "    print('index ={}'.format(index))\n",
    "    index = index + 1\n",
    "\n",
    "\n",
    "    \n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
